package com.itqf.service.impl;
import com.itqf.dao.TypeDao;
import com.itqf.dao.impl.TypeDaoImpl;
import com.itqf.entity.Type;
import com.itqf.entity.User;
import com.itqf.service.TypeService;

import java.sql.SQLException;
import java.util.List;

public class TypeServiceImpl implements TypeService {

    //调用dao层
    private TypeDao typeDao = new TypeDaoImpl();
    @Override
    public List<Type> findAll() throws SQLException {
        //调用dao层
        List<Type> types = typeDao.selectAll();
        if (types != null) {
            //查询到了数据
            return types ;
        }
        return null;
    }

    @Override
    public List<Type> selectAll() throws SQLException {

        List<Type> types = typeDao.queryAll();
        return types;
    }

    @Override
    public void addType(Type type) throws SQLException {
        typeDao.addType(type);
    }

    @Override
    public Type selectTypeByTid(String tid) throws SQLException {

        Type type = typeDao.selectTypeByTid(tid);
        return type;
    }


}
